<template>
  <div>
    <button @click="isShow = !isShow">show/hide</button>
    <Transition name="why" type="transition" mode="out-in" appear>
      <h4 v-if="isShow">sdfdsfsdf</h4>
      <h4 v-else>bbbbbbbbb</h4>
    </Transition>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isShow: false,
    };
  },
};
</script>

<style scoped>
h4 {
  border: 1px solid #ddd;
  width: 100px;
}
/* .why-enter-to,
.why-leave-from {
  opacity: 1;
} */
.why-enter-from,
.why-leave-to {
  opacity: 0;
}
.why-enter-active,
.why-leave-active {
  transition: opacity 1s ease;
}
.why-enter-active {
  animation: bounce 1s ease;
}
.why-leave-active {
  animation: bounce 1s ease reverse;
}
@keyframes bounce {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}
</style>
